seaborn

您所在的位置:网站首页 seaborn color seaborn

seaborn

2023-08-15 01:02| 来源: 网络整理| 查看: 265

seaborn

Hey, folks! In our Seaborn tutorial, we will be focusing on Seaborn Kdeplot.

嘿伙计! 在我们的Seaborn教程中,我们将专注于Seaborn Kdeplot 。

什么是Kdeplot? (What is Kdeplot?)

Kdeplot is a Kernel Distribution Estimation Plot which depicts the probability density function of the continuous or non-parametric data variables i.e. we can plot for the univariate or multiple variables altogether. Using the Python Seaborn module, we can build the Kdeplot with various functionality added to it.

Kdeplot是一个内核分布估计图,它描述了连续或非参数数据变量的概率密度函数,即,我们可以为单变量或多个变量一起绘制图。 使用Python Seaborn模块 ,我们可以构建带有各种功能的Kdeplot。

In order to use the Seaborn module, we need to install and import the module using the below command:

为了使用Seaborn模块,我们需要使用以下命令安装和导入该模块:

pip install seaborn import seaborn 创建单变量Seaborn Kdeplot (Creating a Univariate Seaborn Kdeplot)

The seaborn.kdeplot() function is used to plot the data against a single/univariate variable. It represents the probability distribution of the data values as the area under the plotted curve.

seaborn.kdeplot()函数用于根据单个/单变量变量绘制数据。 它将数据值的概率分布表示为绘制曲线下的面积。

Syntax:

句法:

seaborn.kdeplot(data)

Example 1:

范例1:

import seaborn as sn import matplotlib.pyplot as plt import numpy as np data = np.random.randn(200) res = sn.kdeplot(data) plt.show()

In the above example, we have generated some random data values using the numpy.random.randn() function.

在上面的示例中,我们使用numpy.random.randn()函数生成了一些随机数据值。

Output:

输出:



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3